package com.example.shaidemo;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

public class ChaQiyeActivity extends AppCompatActivity {

    private List<ChaQiye> salary_list=new ArrayList<>();
    ChaQiyeAdapter chaQiyeAdapter;
    ListView listView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_cha_qiye);
        toolBar();

        listView=findViewById(R.id.chaqiye_list);
        salary_list.add(0,new ChaQiye(1,"阿里巴巴","1860","32867","杭州"));
        salary_list.add(1,new ChaQiye(2,"阿里巴巴诚信通","1500","33750","杭州"));
        salary_list.add(2,new ChaQiye(3,"阿里巴巴（北京）软件服务","685","34525","北京"));
        salary_list.add(3,new ChaQiye(4,"腾讯","452","33122","杭州"));


        chaQiyeAdapter = new ChaQiyeAdapter(this, R.layout.list_item_cha_qiye, salary_list);
        listView.setAdapter(chaQiyeAdapter);
    }
    public void toolBar(){
        boolean isImmersive = false;


        final TitleBar titleBar = (TitleBar) findViewById(R.id.title_bar);
        titleBar.setBackgroundColor(getResources().getColor(R.color.colorWhite));
        titleBar.setLeftImageResource(R.drawable.ic_left_orange_24dp);
        titleBar.setTitle("查企业");
        titleBar.setLeftText("成都");
        titleBar.setLeftTextSize(18);
        titleBar.setLeftTextColor(getResources().getColor(R.color.colorLightOrange));
        titleBar.setLeftClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                finish();
            }
        });

        titleBar.setTitleColor(Color.BLACK);

        //沉浸式
        titleBar.setImmersive(isImmersive);
    }
}